package top.idcard.agent.biz.entity;

import com.alibaba.fastjson.JSON;

/**
 * @author wx
 * @version 1.0
 * @date 2021/1/29 5:29 下午
 * 港澳台居住证实体类
 */
public class WorkResidentCertificate extends Certification{

    //姓名  30
    private String name;
    //性别  2
    private Short sex;
    //出生日期  16
    private String birthday;
    //住址  70
    private String addr;
    //身份证号码  36
    private String no;
    //签发机关  30
    private String signOrganization;
    //有效期起始日期  16
    private String validationStart;
    //有效期结束日期  16
    private String validationEnd;
    //通行证号码  18
    private String transferNo;
    //签发次数  4
    private Integer signCount;
    //证件类别  “J”
    private String type;
    //头像  38862
    private byte[] img;
    //指纹  1024
    private byte[] fingerprint;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Short getSex() {
        return sex;
    }

    public void setSex(Short sex) {
        this.sex = sex;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getSignOrganization() {
        return signOrganization;
    }

    public void setSignOrganization(String signOrganization) {
        this.signOrganization = signOrganization;
    }

    public String getValidationStart() {
        return validationStart;
    }

    public void setValidationStart(String validationStart) {
        this.validationStart = validationStart;
    }

    public String getValidationEnd() {
        return validationEnd;
    }

    public void setValidationEnd(String validationEnd) {
        this.validationEnd = validationEnd;
    }

    public String getTransferNo() {
        return transferNo;
    }

    public void setTransferNo(String transferNo) {
        this.transferNo = transferNo;
    }

    public Integer getSignCount() {
        return signCount;
    }

    public void setSignCount(Integer signCount) {
        this.signCount = signCount;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public byte[] getImg() {
        return img;
    }

    public void setImg(byte[] img) {
        this.img = img;
    }

    public byte[] getFingerprint() {
        return fingerprint;
    }

    public void setFingerprint(byte[] fingerprint) {
        this.fingerprint = fingerprint;
    }

    @Override
    public CertificationEnum certificationType() {
        return CertificationEnum.Hong;
    }

    @Override
    public byte[] getBytes() {
        return new byte[0];
    }

    @Override
    public WorkResidentCertificate parseFrom(byte[] bytes){
        String str = new String(bytes);
        return JSON.parseObject(str, WorkResidentCertificate.class);
    }
}
